package com.example.controller;

import java.util.Arrays;

import com.example.mapper.EmpMapper;
import com.example.pojo.Emp;
import com.example.service.impl.EmpServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.example.vo.ResultVo;
import com.github.pagehelper.PageInfo;
import com.example.pojo.IncumbentCertify;
import com.example.service.IIncumbentCertifyService;
import io.swagger.annotations.Api;
/**
 * <p>
 * 在职证明表 前端控制器
 * </p>
 *
 * @author wsl
 * @since 2022-05-26
 */
@RestController
@RequestMapping("/incumbentCertify")
@Api(tags = "在职证明表",value = "")
@CrossOrigin(allowCredentials = "true")
public class IncumbentCertifyController {

    @Autowired
    private IIncumbentCertifyService iics;
    @Autowired
    private EmpMapper em;

    @ApiOperation(value = "查询在职证明表")
    @GetMapping("")
    public ResultVo selEmpByid(Integer val){
        if (val != null){
            return ResultVo.response(em.selEmpDept(val));
        }
       return ResultVo.error();
    }

    @ApiOperation("新增在职证明")
    @PostMapping("")
    public ResultVo insIncumbentCertify(@RequestBody IncumbentCertify ic){
        System.err.println(" --- 《 " + ic);
        if (ic != null){
            boolean save = iics.save(ic);
            if (save){
                return ResultVo.ok();
            }
        }
        return ResultVo.error();
    }

}
